<!--#include file="CheckSession.asp"-->
<!--#include file="../inc/PublicFun.Asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
    <title>��̨����</title>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" charset="utf-8" src="../webedit/kindeditor.js"></script>
    <script type="text/javascript">
        KE.show({
            id: 'NewsContent',
            imageUploadJson: '../../upload_json.asp',
            fileManagerJson: '../../file_manager_json.asp',
            allowFileManager: true,
            afterCreate: function (id) {
                KE.event.ctrl(document, 13, function () {
                    KE.util.setData(id);
                    document.forms['form1'].submit();
                });
                KE.event.ctrl(KE.g[id].iframeDoc, 13, function () {
                    KE.util.setData(id);
                    document.forms['form1'].submit();
                });
            }
        });
    </script>
</head>
<body>
<%
strAction = Request("action")
	strNewsId = Request("NewsId")
		
	if strAction = "s"  then
		if (strNewsId = "") then
			call insert(request . form, "News")
			Response . Write("<script language='javascript'>alert('��ӳɹ���');window.location.href='Admin_NewsAdd.asp'</script>")
		else
			call data(request . form, "News", "newsid=" & strNewsId & "")
			Response . Write("<script language='javascript'>alert('�޸ĳɹ���');window.location.href='Admin_NewsAdd.asp'</script>")
		end if
end if

If strNewsId <> "" Then
		Set Rs = Server . CreateObject("Adodb.RecordSet")
		Sql = "Select * from News where NewsId=" & strNewsId & ""
		Rs . open Sql,Conn,1,3
			If Not(Rs . Eof And Rs . Eof) then
				NewsTitle = Rs("NewsTitle")
				NewsTitle2 = Rs("NewsTitle2")
				NewsTypeId = Rs("NewsTypeId")
				NewsContent = Rs("NewsContent")
			End If
    Rs . Close()
Set Rs = Nothing
	End If

%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td height="50" align="center" class="title">�����Ϣ</td>
    </tr>
</table>
<div>&nbsp;</div>
<table width="100%" border="1" align="center" cellpadding="5" cellspacing="0" style="border-collapse:collapse">
    <form action="?action=s&NewsId=<%= strNewsId %>" method="post" name="form1">
        <tr>
            <td width="150" align="right" nowrap>��Ϣ���⣺</td>
            <td nowrap><input name="NewsTitle" class="inputtext" value="<%= NewsTitle %>" type="text"
                              style="width:500px"></td>
        </tr>
        <tr>
            <td width="150" align="right" nowrap>���ߣ�</td>
            <td nowrap><input name="NewsTitle2" class="inputtext" value="<%= NewsTitle2 %>" type="text"
                              style="width:500px"></td>
        </tr>
        <tr>
            <td align="right" nowrap>��Ϣ���</td>
            <td valign="top" nowrap>
                <select name="NewsTypeId" style="width:300px">
                    <%
                    Set Rs = Server . CreateObject("adodb.recordset")
			sql = "select * from NewsType where NewsTypeCheck=1 order by NewsTypeOrder asc ,Times desc"
			Rs . Open sql,conn,1,3
			do while not Rs . eof
		  %>
                    <option
                        value="<%= Rs("NewsTypeId") %>" <% if NewsTypeId = Rs("NewsTypeId") then response . Write("selected") end if%>><%= Rs("NewsTypeName") %></option>
                    <%
                    Rs . MoveNext
			Loop
			Rs . close()
			Set Rs = nothing
		  %>
                </select>
            </td>
        </tr>
        <tr>
            <td align="right" nowrap>��Ϣ���ݣ�</td>
            <td nowrap>
                <textarea id="NewsContent" name="NewsContent"
                          style="height:380px;width:630px"><%= NewsContent %></textarea>

            </td>
        </tr>

        <tr>
            <td>&nbsp;</td>
            <td><input type="hidden" value="<%= now() %>" name="Times" id="Times"><input name="submit1" type="submit"
                                                                                         class="button" value="ȷ���ύ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input
                    name="reset" type="reset" class="button" value="ȡ����д"></td>
        </tr>
    </form>
</table>
</body>
</html>
<%
conn . close()
	set conn = nothing
%>